package banking7.domain;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:恋恋
 * Date:2022-11-03
 * Time:12:30
 */
public class Bank {
    Customer[] customers;
    int numberOfCustomer;
//Bank构造器也应该是私有的
    private Bank(Customer[] customers) {
        this.customers = customers;
    }
    public void addCustomer(String firstName,String lastName){
        Customer customer=new Customer(firstName,lastName);
        customers[numberOfCustomer]=customer;
        numberOfCustomer++;
    }
    public int getNumberOfCustomer() {
        return numberOfCustomer;
    }

    public Customer getCustomer(int i){
        return customers[i];
    }
    // 修改 Bank 类，创建名为 getBanking 的公有静态方法，它返回一个 Bank类的实例。
    public static Bank getBank(){
        return new Bank(new Customer[10]);
    }
}
